package com;

public class TestMergeNewArr {
	
	public static void main(String[] args) {
		String product = "9418A1030034Q";
		Integer qTimeDay = 20;
		String productDay = "9418A1030034Q:10;9418A1030054Q:30;9418A1030084Q:50;";
		System.out.println(productDay);
		String[] prodArrs = productDay.split(";");
		for (String pd : prodArrs) {
			if(pd.contains(product)) {
				String startPd = productDay.substring(0, productDay.indexOf(product) + product.length()+1);
				String endPd = productDay.substring(productDay.indexOf(product) + product.length()+1);
				endPd = qTimeDay + endPd.substring(endPd.indexOf(";"));
				productDay = startPd + endPd;
			}
		}
		System.out.println(productDay);
		
	}

}
